package com.jysz.certificate.web.action.cs;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.jysz.certificate.action.AbstractBaseAction;
import com.jysz.certificate.persistence.enums.AttachmentType;
import com.jysz.certificate.persistence.enums.WorkflowOperateType;
import com.jysz.certificate.persistence.enums.WorkflowState;
import com.jysz.certificate.persistence.enums.WorkflowType;
import com.jysz.certificate.persistence.enums.cs.TheNetWorkStatus;
import com.jysz.certificate.persistence.model.cm.Certification;
import com.jysz.certificate.persistence.model.cm.CertificationDTO;
import com.jysz.certificate.persistence.model.core.Attachment;
import com.jysz.certificate.persistence.model.cs.TheNetwork;
import com.jysz.certificate.persistence.model.cs.TheNetworkList;
import com.jysz.certificate.persistence.model.cs.TheObject;
import com.jysz.certificate.persistence.model.system.Brand;
import com.jysz.certificate.persistence.model.system.Financial;
import com.jysz.certificate.persistence.model.system.Organization;
import com.jysz.certificate.persistence.model.system.Shop;
import com.jysz.certificate.persistence.model.system.Treaty;
import com.jysz.certificate.persistence.model.system.User;
import com.jysz.certificate.persistence.model.workflow.Workflow;
import com.jysz.certificate.service.cm.CertificationService;
import com.jysz.certificate.service.core.AttachmentService;
import com.jysz.certificate.service.cs.TheNetworkListService;
import com.jysz.certificate.service.cs.TheNetworkService;
import com.jysz.certificate.service.system.BrandService;
import com.jysz.certificate.service.system.FinancialService;
import com.jysz.certificate.service.system.OrganizationService;
import com.jysz.certificate.service.system.ShopService;
import com.jysz.certificate.service.system.UserService;
import com.jysz.certificate.service.workflow.WorkflowService;
import com.jysz.webcore.ssh.orm.hibernate.support.Page;

@Controller
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Namespace("/cs/ct")
public class TheNetworkAction extends AbstractBaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Resource
	private TheNetworkService tNetworkService;
	@Resource
	private TheNetworkListService theNetworkListService;
	@Resource
	private UserService userService;
	@Resource
	private WorkflowService workflowService;// 流程
	@Resource
	private FinancialService financialService;
	@Resource
	private BrandService brandService;
	@Resource
	private ShopService shopService;
	@Resource
	private OrganizationService organizationService;
	@Resource
	private CertificationService cfService;// 合格证核心Service
	@Resource
	private AttachmentService attService;

	private Long finId;// 金融机构ID
	private Long id;
	private Long brandId;// 主机厂id
	private Long shopId;// 店铺ID
	private Long theIdLong;

	public Long getTheIdLong() {
		return theIdLong;
	}

	public void setTheIdLong(Long theIdLong) {
		this.theIdLong = theIdLong;
	}

	private Integer flag;
	private TheNetwork theNetwork;
	private TheNetworkList tNetworkList;// 二网记录列表
	private TheNetwork tNetworkDTO;// 查询条件
	private List<Financial> financials;// 金融机构
	private List<Brand> brands;// 主机厂
	private Integer state;// 合格证状态
	private String[] theName;
	private String userName;// 驻店员姓名
	private String userQName;// 区域经理姓名
	private String Num;// 申请单号
	private List<Shop> shops;
	private List<TheObject> theObjects;
	private Integer markSave;// 保存 提交标示
	private Date startDate;
	private Long backups;
	private Date endDate;
	private Integer stateT;
	private Workflow workflow;// 释放单关联的流程
	private TheNetwork search;
	private String pageData;
	private String allData;
	private String cmId;
	private Integer caozuo;
	private String msg;// 审核意见
	private Long[] longId;// 审核ID
	
	private String managerUser;//经理
	private String markShop;
	
	private String groupIds;//合格证ID组
	private String chassis;//车架号
	

	private File file;// 附件
	private String fileFileName;// 文件名称

	public void bfList() {
		StringBuilder names = new StringBuilder();
		financials = financialService.findAll();
		brands = brandService.findAll();
		List<Organization> orgs = organizationService.findShopsByCurrentUser();
		shops = new ArrayList<Shop>();
		if (orgs != null && orgs.size() > 0) {
			for (Iterator<Organization> iterator = orgs.iterator(); iterator
					.hasNext();) {
				Organization org = iterator.next();
				names.append(org.getName());
				Shop shop = shopService.find(org.getObjectId());
				shops.add(shop);
			}
		}
	}

	@Action(ADD)
	public String add() {
		this.bfList();
		pageData = null;
		allData = null;
		setRedirectUrl("index.do?currentPage=" + getCurrentPage(),
				"tNetworkDTO", tNetworkDTO);
		return ADD;
	}
	
	/**
	 * opne页面选择合格证
	 * @return
	 */
	@Action("openChoose")
	public String openChoose(){
		Financial financial = new Financial();
		boolean m =false;
		financial.setId(finId);
		Brand brand = new Brand();
		brand.setId(brandId);
		Shop shop = shopService.find(shopId);
		setId(id);
		CertificationDTO certification = new CertificationDTO();

		certification.setBrand(brand);
		certification.setFinancial(financial);
		certification.setShop(shop);
		certification.setState(state);
		certification.setChoose(true);
		if(StringUtils.isNotBlank(chassis)){
			certification.setChassis(chassis);
		}
		Long[] idLongs = new Long[9];
		if(StringUtils.isNotBlank(groupIds)){
			String[] valueID = groupIds.split(",");
			idLongs = new Long[valueID.length];
			for(int i=0;i<valueID.length;i++){
				idLongs[i] = Long.parseLong(valueID[i]);
			}
			m =true;
		}
		Page<Certification> page = cfService.fianPageChiss(certification, this.getCurrentPage(), 15,idLongs,m);
		this.setPage(page);
		return "openChoose";
	}
	/**
	 * 合格证二网申请列表
	 * @return
	 */
	@Action("addChoose")
	public String addChoose(){
		boolean masg =  true;
		TheNetwork t = null;
		if (id != null) {
			theIdLong = id;
			t = tNetworkService.find(id);
			finId = t.getFinancial().getId();
			brandId = t.getBrand().getId();
			shopId = t.getShop().getId();
			attachs = attService.findAll(null, id, AttachmentType.THEINTERNET);
			masg = false;
			setWorkflow(id);
			state = 2;
		}
		Financial financial = new Financial();
		financial.setId(finId);
		Brand brand = new Brand();
		brand.setId(brandId);
		Shop shop = shopService.find(shopId);

		CertificationDTO certification = new CertificationDTO();

		certification.setBrand(brand);
		certification.setFinancial(financial);
		certification.setShop(shop);
		certification.setState(state);
		certification.setChoose(true);
		
		Long[] idLongs = new Long[9];
		if(StringUtils.isNotBlank(groupIds)){
			String[] valueID = groupIds.split(",");
			idLongs = new Long[valueID.length];
			for(int i=0;i<valueID.length;i++){
				idLongs[i] = Long.parseLong(valueID[i]);
			}
		}
		certifications = cfService.listCertifications(certification,idLongs,masg);

		Gson gson = new Gson();
		JsonParser parser = new JsonParser();

		List<Certification> addList = new ArrayList<Certification>();
		if (null != t) {
			List<Certification> currList = certifications;
			
			masg = true;
			for (int i = 0; i < currList.size(); i++) {
				Certification cer = currList.get(i);
				for (int j = 0; j < t.getTheNetworks().size(); j++) {
					TheNetworkList thenet = t.getTheNetworks().get(j);
					if (cer.getId().equals(thenet.getCreId()) && StringUtils.isNotBlank(thenet.getTheAddress())) {
						cer.setCopyShow(cer.getTheAddress());//复制二网地址，只用来在页面做显示用
						cer.setTheAddress(thenet.getTheAddress());
						addList.add(cer);
						break;
					}
				}
			}
			certifications =addList;
		}else{
			addList = certifications;
		}


		ArrayList<TheObject> allList = new ArrayList<TheObject>();
		
		if(addList != null && addList.size()>0){
			for(Certification cers : addList){
				TheObject obj = convertCertification(cers,masg);
				allList.add(obj);
			}
		}
		
		if (null == getAllData() || getAllData().equals("")) {
			setAllData(gson.toJson(allList));

		} else {

			JsonArray Jarray = parser.parse(getAllData()).getAsJsonArray();

			for (JsonElement obj : Jarray) {

				TheObject cf = gson.fromJson(obj, TheObject.class);

				if (!(allList.contains(cf))) {
					
					allList.add(cf);
				}else{
					for(int i=0;i<allList.size();i++){
						TheObject to = allList.get(i);
						if(to.getId().equals(cf.getId())){
							allList.remove(i);
							allList.add(cf);
						}
					}
				}
			}
			// 全局数据
			setAllData(gson.toJson(allList));
		}
		certifications = new ArrayList<Certification>();
		groupIds = "";
		for(TheObject theObject : allList){
			Certification certifica = convertTheObject(theObject);
//			certifica.setTheAddress(theObject.getTheAddress())
			groupIds += certifica.getId()+",";
			certifications.add(certifica);
		}

		this.bfList();
		setRedirectUrl("index.do?currentPage=" + getCurrentPage(),"tNetworkDTO", tNetworkDTO);
	 
		return ADD;
	}
	 
	public String previousPage() {
		return ADD;
	}

	@Action("save")
	public String save() {

		Financial financial = new Financial();
		financial.setId(finId);

		Brand brand = new Brand();
		brand.setId(brandId);

		Shop shop = new Shop();
		shop.setId(shopId);

		Gson gson = new Gson();

		JsonParser parser = new JsonParser();
		System.out.println(allData);
		JsonArray allJarray = parser.parse(getAllData()).getAsJsonArray();

		ArrayList<TheObject> allList = new ArrayList<TheObject>();

		for (JsonElement obj : allJarray) {

			TheObject cf = gson.fromJson(obj, TheObject.class);

			allList.add(cf);
		}
		if (allList.size() == 0) {
			setSuccessPopMessage("没有需要变更的二网");
			return SHOW_MSG_PAGE;
		}

		TheNetwork theNetw = new TheNetwork();
		TheNetwork theN = null;
		Shop shopMark = shopService.find(shopId);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		String theNumber = shopMark.getShopMark() + "_"
				+ sdf.format(new Date()) + "_" + getUser().getId();
		if (theIdLong != null) {
			theN = tNetworkService.find(theIdLong);
			tNetworkService.destory(theIdLong);
		}
		theNetw.setBrand(brand);
		theNetw.setFinancial(financial);
		theNetw.setShop(shop);
		theNetw.setApplicationDate(new Date());
		theNetw.setTheNumber(theNumber);
		if (markSave == 1) {
			theNetw.setState(TheNetWorkStatus.SUBMITED);// 提交
		} else {
			theNetw.setState(TheNetWorkStatus.NOTSTART);// 暂存
		}
		tNetworkService.save(theNetw);
		List<TheNetworkList> netWorkList = new ArrayList<TheNetworkList>();
		for (TheObject t : allList) {
			if (StringUtils.isNotBlank(t.getTheAddress())) {
				TheNetworkList network = new TheNetworkList();
				network.setTheNetwork(theNetw);
				network.setCreId(t.getId());
				network.setChassis(t.getChassis());
				network.setCertificationNum(t.getCertificationNum());// ---------------------------------------
				network.setEngine(t.getEngine());
				network.setMotorcycleType(t.getMotorcycleType());
				network.setShopName(t.getShopName());
				network.setSupplyPrice(t.getSupplyPrice());
				network.setTheAddress(t.getTheAddress());
				network.setIsNotPass("未审核");
				netWorkList.add(network);
			}
		}
//		if (theN != null) {
//			for (TheNetworkList t : theN.getTheNetworks()) {
//				boolean bo = true;
//				for (TheObject j : allList) {
//					if (t.getCreId().equals(j.getId())) {
//						bo = false;
//						break;
//					}
//				}
//				if (bo) {
//					t.setId(null);
//					t.setTheNetwork(theNetw);
//					netWorkList.add(t);
//				}
//			}
//		}
		if (netWorkList.size() > 0) {
			for (TheNetworkList t : netWorkList) {
				theNetworkListService.save(t);
			}
			theNetw.setTheNumber(theNetw.getTheNumber() + "" + theNetw.getId());
			theNetw.setAmount(netWorkList.size());
			tNetworkService.save(theNetw, file, fileFileName, getUser());
			if (theNetw.getState().equals(TheNetWorkStatus.SUBMITED)) {
				if(!StringUtils.isNotBlank(msg)){
					msg = "新建二网审核";
				}
				
				Workflow w = null;
				if(id!=null){
					w=workflowService.find(WorkflowType.SECOND, id);
				}
				if(w != null){//判断是否存在该流程！
					workflowService.audit(getUser(), w, WorkflowState.SUBMITED, WorkflowOperateType.SUBMIT, "退回再提交");
				}else{
					workflowService.addWorkflow(getUser(), theNetw.getId(),WorkflowState.SUBMITED,
							WorkflowType.SECOND,
							TheNetwork.class,msg );
				}

			}
			setSuccessPopMessage("数据添加成功");
			return SHOW_MSG_PAGE;
		} else {
			tNetworkService.destory(theNetw.getId());
			setSuccessPopMessage("没有需要变更的二网");
			return SHOW_MSG_PAGE;
		}

	}

	/**
	 * 转换类的引用关系
	 * 
	 * @param certification
	 * @return TheObject
	 */
	private TheObject convertCertification(Certification certification,boolean bo) {

		TheObject obj = new TheObject();
		if(certification.getCertificationNum() != null)
			obj.setCertificationNum(certification.getCertificationNum());
		if(certification.getTheAddress() != null)
			obj.setCopyShow(certification.getTheAddress());
		if(certification.getId() != null)
			obj.setId(certification.getId());
		if(certification.getChassis() != null)
			obj.setChassis(certification.getChassis());
		if(certification.getEngine() != null)
			obj.setEngine(certification.getEngine());
		if(certification.getMotorcycleType() != null)
			obj.setMotorcycleType(certification.getMotorcycleType());
		if(certification.getShop() != null)
			obj.setShopName(certification.getShop().getShopName());
		if(certification.getSupplyPrice() != null)
			obj.setSupplyPrice(certification.getSupplyPrice());
		if(bo){//如果是修改的时候需要将二网地址赋值
			obj.setTheAddress(certification.getTheAddress());
			if(certification.getCopyShow() != null){
				obj.setCopyShow(certification.getCopyShow());
			}
		}
		

		return obj;
	}

	/**
	 * 提交
	 */
	@Action("saveSubmit")
	public String saveSubmit() {
		TheNetwork theNetworkqNetwork = tNetworkService.find(id);
		theNetworkqNetwork.setState(TheNetWorkStatus.SUBMITED);
		tNetworkService.save(theNetworkqNetwork);
		if(StringUtils.isBlank(msg)){
			msg = "新建二网审核";
		}
		Workflow w = workflowService.find(WorkflowType.SECOND, id);
		if(w != null){//判断是否存在该流程！
			workflowService.audit(getUser(), w, WorkflowState.SUBMITED, WorkflowOperateType.SUBMIT, msg);
		}else{
			workflowService.addWorkflow(getUser(), theNetworkqNetwork.getId(),
					WorkflowState.SUBMITED, WorkflowType.SECOND, TheNetwork.class,
					msg);
		}

		setRedirectUrl("index.do?currentPage=" + getCurrentPage(),
				"tNetworkDTO", tNetworkDTO);
		setSuccessPopMessage("提交数据成功");
		return SHOW_MSG_PAGE;
	}

	/**
	 * 转换类的引用关系
	 * 
	 * @param certification
	 * @return TheObject
	 */
	private Certification convertTheObject(TheObject theObject) {

		Certification obj = new Certification();

		obj.setCertificationNum(theObject.getCertificationNum());
		obj.setId(theObject.getId());
		obj.setChassis(theObject.getChassis());
		obj.setCopyShow(theObject.getCopyShow());
		obj.setEngine(theObject.getEngine());
		obj.setMotorcycleType(theObject.getMotorcycleType());
		obj.setSupplyPrice(theObject.getSupplyPrice());
		obj.setTheAddress(theObject.getTheAddress());

		return obj;
	}

	/**
	 * 加载审核页面
	 */
	@Action("verify")
	public String verify() {
		theNetwork = gTheNetwork(id);
		if (flag != null) {
			setRedirectUrl(getContextPath() + "/workflow/index.do?currentPage="
					+ getCurrentPage(), "search", search);
		} else {
			setRedirectUrl("index.do?currentPage=" + getCurrentPage(),
					"tNetworkDTO", tNetworkDTO);
		}
		setWorkflow(id);
		attachs = attService.findAll(null, id, AttachmentType.THEINTERNET);
		return "verify";
	}

	/**
	 * 审核详情
	 * 
	 * @return
	 */
	@Action("view")
	public String view() {
		if (id == null) {
			setSuccessPopMessage("缺少必要参数ID,请重新尝试");
			setRedirectUrl("index.do?currentPage=" + getCurrentPage());
			return SHOW_MSG_PAGE;
		}
		theNetwork = gTheNetwork(id);
		attachs = attService.findAll(null, id, AttachmentType.THEINTERNET);
		setWorkflow(id);
		return "view";
	}

	private void setWorkflow(Long theId) {
		workflow = workflowService.find(WorkflowType.SECOND, theId);
	}

	@Action("addVerify")
	public String addVerify() {
		TheNetwork theNetw = gTheNetwork(id);
		if (caozuo == 1) {// 同意
			for (int j = 0; j < theNetw.getTheNetworks().size(); j++) {
				TheNetworkList t = theNetw.getTheNetworks().get(j);
				boolean mark = true;
				for (int i = 0; i < longId.length; i++) {
					if (t.getId().equals(longId[i])) {
						Certification c = cfService.find(t.getCreId());
						c.setTheAddress(t.getTheAddress());
						c.setApplyTheDate(new Date());
						cfService.save(c);
						mark = false;
						break;
					}
				}
				if (mark) {
					t.setIsNotPass("退回");
					

				}else{
					t.setIsNotPass("通过");
				}
				theNetworkListService.save(t);
			}
			theNetw.setState(TheNetWorkStatus.FINISH);
			Integer s = longId.length;
			theNetw.setPassAmount(s);
			workflowService.audit(getUser(),
					workflowService.find(WorkflowType.SECOND, id),
					WorkflowState.FINISH, WorkflowOperateType.PASS, msg);
		} else {
			for (int j = 0; j < theNetw.getTheNetworks().size(); j++) {
				TheNetworkList t = theNetw.getTheNetworks().get(j);
				t.setIsNotPass("退回");
				theNetworkListService.save(t);
			}
				
			theNetw.setState(TheNetWorkStatus.REFUSED);
			theNetw.setPassAmount(0);
			workflowService.audit(getUser(),
					workflowService.find(WorkflowType.SECOND, id),
					WorkflowState.REFUSED, WorkflowOperateType.REFUSE, msg);
		}
		tNetworkService.save(theNetw);
		setSuccessPopMessage("提交数据成功");
		return SHOW_MSG_PAGE;
	}

	/**
	 * 查询申请单
	 */
	@Action(INDEX)
	public String index() {
		this.bfList();
		User user = null;//驻店员
		User manager = null;//区域经理
		if (StringUtils.isNotBlank(userName)) {
			user = userService.getUserByProperty("name", userName);
		}
		if (StringUtils.isNotBlank(managerUser)) {//判断经理条件是否为空
			manager = userService.getUserByProperty("name", managerUser);
		}  
		if(StringUtils.isNotBlank(markShop)){
			if(search == null){
				search = new TheNetwork();
			}
			Shop shop = new Shop();
			shop.setShopMark(markShop);
			search.setShop(shop);
		}
		setPage(tNetworkService.selectPage(search, this.getCurrentPage(),this.getPageSize(), startDate, endDate, stateT, user,manager));
		setRedirectUrl("index.do?currentPage=" + getCurrentPage(),
				"tNetworkDTO", tNetworkDTO);
		return INDEX;
	}

	/**
	 * 删除
	 * 
	 * @param shopId
	 * @return
	 */
	@Action(DELETE)
	public String delete() {
		tNetworkService.destoryAndWorkflow(id);
		setRedirectUrl("index.do?currentPage=" + getCurrentPage(),
				"tNetworkDTO", tNetworkDTO);
		setSuccessPopMessage("删除数据成功");
		return SHOW_MSG_PAGE;
	}

	public TheNetwork gTheNetwork(Long id) {

		return tNetworkService.find(id);
	}

	/**
	 * 查询申请单
	 * 
	 * @param shopId
	 * @return
	 */
	@Action("sole")
	public String sole() {
		theNetwork = gTheNetwork(id);
		setWorkflow(id);
		attachs = attService.findAll(null, id, AttachmentType.THEINTERNET);
		return "sole";
	}

	/*
	 * 获得区域经理名字
	 */
	public String getShopUserName(Long shopId) {
		StringBuilder names = new StringBuilder();
		List<Organization> orgs = organizationService
				.findUserDomainByShopId(shopId);
		if (orgs != null && orgs.size() > 0) {
			for (Iterator<Organization> iterator = orgs.iterator(); iterator
					.hasNext();) {
				Organization org = iterator.next();
				names.append(org.getName());
				if (iterator.hasNext()) {
					names.append("，");
				}
			}
		}
		return names.toString();
	}

	/*
	 * 获得驻店员名字
	 */
	public String findUserShopByShopId(Long shopId) {
		StringBuilder names = new StringBuilder();
		List<Organization> orgs = organizationService
				.findUserShopByShopId(shopId);
		if (orgs != null && orgs.size() > 0) {
			for (Iterator<Organization> iterator = orgs.iterator(); iterator
					.hasNext();) {
				Organization org = iterator.next();
				names.append(org.getName());
				if (iterator.hasNext()) {
					names.append("，");
				}
			}
		}
		return names.toString();
	}

	/** 根据协议取出相对应的金融机构 */
	@Action("shopFinal")
	public String shopFinal() {
		Shop shop = shopService.find(shopId);
		List<String> list = new ArrayList<String>();
		String text = "";
		if (null != shop) {
			if (shop.getTreaties() != null && shop.getTreaties().size() > 0) {
				for (Treaty treaty : shop.getTreaties()) {
					if (text.indexOf(treaty.getFinancial().getName()) == -1) {
						String texta = treaty.getFinancial().getId() + ":"
								+ treaty.getFinancial().getName();
						text += treaty.getFinancial().getId() + ":"
								+ treaty.getFinancial().getName();
						list.add(texta);
					}
				}
			}
			if (list.size() > 0) {
				Gson gson = new GsonBuilder()
						.excludeFieldsWithoutExposeAnnotation().create();
				this.setJsonText(gson.toJson(list));
			} else {
				Gson gson = new GsonBuilder()
						.excludeFieldsWithoutExposeAnnotation().create();
				this.setJsonText(gson.toJson(null));
			}

		}
		return JSON_PAGE;
	}

	@Action("detailsBrand")
	// 查询默认渠道
	public String detailsBrand() {
		Shop shop = shopService.find(shopId);
		String text = "";
		List list = new ArrayList();
		if (shop != null && shop.getBrands().size() > 0) {
			for (Brand brand : shop.getBrands()) {
				if (text.indexOf(brand.getName()) == -1) {
					String texta = brand.getId() + ":" + brand.getName();
					text += brand.getId() + ":" + brand.getName();
					list.add(texta);
				}
			}
		}
		if (list.size() > 0) {
			Gson gson = new GsonBuilder()
					.excludeFieldsWithoutExposeAnnotation().create();
			this.setJsonText(gson.toJson(list));
		} else {
			Gson gson = new GsonBuilder()
					.excludeFieldsWithoutExposeAnnotation().create();
			this.setJsonText(gson.toJson(null));
		}
		return JSON_PAGE;
	}

	private List<Attachment> attachs;// 附件

	public List<Attachment> getAttachs() {
		return attachs;
	}

	public void setAttachs(List<Attachment> attachs) {
		this.attachs = attachs;
	}

	public String getFileFileName() {
		return fileFileName;
	}

	public void setFileFileName(String fileFileName) {
		this.fileFileName = fileFileName;
	}

	public Workflow getWorkflow() {
		return workflow;
	}

	public void setWorkflow(Workflow workflow) {
		this.workflow = workflow;
	}

	public Long[] getLongId() {
		return longId;
	}

	public void setLongId(Long[] longId) {
		this.longId = longId;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Integer getCaozuo() {
		return caozuo;
	}

	public void setCaozuo(Integer caozuo) {
		this.caozuo = caozuo;
	}

	public Integer getFlag() {
		return flag;
	}

	public void setFlag(Integer flag) {
		this.flag = flag;
	}

	private int danqian;

	public Long getBackups() {
		return backups;
	}

	public void setBackups(Long backups) {
		this.backups = backups;
	}

	public Integer getMarkSave() {
		return markSave;
	}

	public void setMarkSave(Integer markSave) {
		this.markSave = markSave;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserQName() {
		return userQName;
	}

	public void setUserQName(String userQName) {
		this.userQName = userQName;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public Integer getStateT() {
		return stateT;
	}

	public void setStateT(Integer stateT) {
		this.stateT = stateT;
	}

	public TheNetwork getSearch() {
		return search;
	}

	public void setSearch(TheNetwork search) {
		this.search = search;
	}

	public int getDanqian() {
		return danqian;
	}

	public void setDanqian(int danqian) {
		this.danqian = danqian;
	}

	private String[] mid;

	public List<TheObject> getTheObjects() {
		return theObjects;
	}

	public void setTheObjects(List<TheObject> theObjects) {
		this.theObjects = theObjects;
	}

	public String[] getMid() {
		return mid;
	}

	public void setMid(String[] mid) {
		this.mid = mid;
	}

	public String getCmId() {
		return cmId;
	}

	public void setCmId(String cmId) {
		this.cmId = cmId;
	}

	private List<Certification> certifications;// 合格证

	public String getPageData() {
		return pageData;
	}

	public void setPageData(String pageData) {
		this.pageData = pageData;
	}

	public String getAllData() {
		return allData;
	}

	public void setAllData(String allData) {
		this.allData = allData;
	}

	public List<Certification> getCertifications() {
		return certifications;
	}

	public void setCertifications(List<Certification> certifications) {
		this.certifications = certifications;
	}

	public String[] getTheName() {
		return theName;
	}

	public void setTheName(String[] theName) {
		this.theName = theName;
	}

	private List<Organization> orgs;

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Long getShopId() {
		return shopId;
	}

	public void setShopId(Long shopId) {
		this.shopId = shopId;
	}

	public List<Shop> getShops() {
		return shops;
	}

	public void setShops(List<Shop> shops) {
		this.shops = shops;
	}

	public List<Organization> getOrgs() {
		return orgs;
	}

	public void setOrgs(List<Organization> orgs) {
		this.orgs = orgs;
	}

	public String getNum() {
		return Num;
	}

	public void setNum(String num) {
		Num = num;
	}

	public List<Financial> getFinancials() {
		return financials;
	}

	public void setFinancials(List<Financial> financials) {
		this.financials = financials;
	}

	public List<Brand> getBrands() {
		return brands;
	}

	public void setBrands(List<Brand> brands) {
		this.brands = brands;
	}

	public TheNetwork getTheNetwork() {
		return theNetwork;
	}

	public void setTheNetwork(TheNetwork theNetwork) {
		this.theNetwork = theNetwork;
	}

	public TheNetworkList gettNetworkList() {
		return tNetworkList;
	}

	public void settNetworkList(TheNetworkList tNetworkList) {
		this.tNetworkList = tNetworkList;
	}

	public TheNetwork gettNetworkDTO() {
		return tNetworkDTO;
	}

	public void settNetworkDTO(TheNetwork tNetworkDTO) {
		this.tNetworkDTO = tNetworkDTO;
	}

	public Long getFinId() {
		return finId;
	}

	public void setFinId(Long finId) {
		this.finId = finId;
	}

	public Long getBrandId() {
		return brandId;
	}

	public void setBrandId(Long brandId) {
		this.brandId = brandId;
	}

	public File getFile() {
		return file;
	}

	public void setFile(File file) {
		this.file = file;
	}

	public String getManagerUser() {
		return managerUser;
	}

	public void setManagerUser(String managerUser) {
		this.managerUser = managerUser;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public String getMarkShop() {
		return markShop;
	}

	public void setMarkShop(String markShop) {
		this.markShop = markShop;
	}

	public String getChassis() {
		return chassis;
	}

	public void setChassis(String chassis) {
		this.chassis = chassis;
	}

	public String getGroupIds() {
		return groupIds;
	}

	public void setGroupIds(String groupIds) {
		this.groupIds = groupIds;
	}

}
